#ifndef __STRING_INCLUDED__
#define __STRING_INCLUDED__
#include <string>
#endif



#ifndef __IOSTREAM_INCLUDED__
#define __IOSTREAM_INCLUDED__
#include <iostream>
#endif

#ifndef __CXMLCONTAINERLIST_INCLUDED__
#define __CXMLCONTAINERLIST_INCLUDED__
#include "c_xml_container_list.h"
#endif

#ifndef __VECTOR_INCLUDED__
#define __VECTOR_INCLUDED__
#include <vector>
#endif


#ifndef __XMLPARSE_INCLUDED__
#define __XMLPARSE_INCLUDED__
#include "xml_parse_command.h"
#endif

#ifndef __CXMLDTD_INCLUDED__
#define __CXMLDTD_INCLUDED__
#include "c_xml_dtd_node.h"
#endif

#ifndef __FSTREAM_INCLUDED__
#define __FSTREAM_INCLUDED__
#include <fstream>
#endif


class c_xmlparser{
          
	private:	  
			 std::ifstream infile;
             int OpenFile(char* file_to_read);

			 std::vector<std::string> lines; // ;lineas del archivo
			 std::string xml_info; // lineas concatenadas en un solo string
             std::vector<c_xml_parse_command*> xml_lines; // vector de comando para agregar xml a estructura
			 std::vector<std::string> Parse_Errors;   // Vector de descripcion de errores
			 std::vector<char> Expected_Char_List;   //  Vector con lista de caracteres esperadosw segun el estado
			 c_xml_parse_command* Command_Xml; // Comando para la lista
             std::vector<c_xml_dtd_node*> dtd_lines; // vector de comando para agregar xml a estructura
			 c_xml_dtd_node* dtd_node;

			 int add_expected(int from_char, int to_char);
			 int add_expected(char expected_char);
			 int del_expected(int from_char, int to_char);
			 int del_expected(char expected_char);
			 int empty_expected();
			 int is_expected(char expected_char);

             int Parse_Xml_Info(void); // Parse la lista de comando xml y la guarda en la estructura
			 int Parse_Xml(void);

			 int pertenece_dtd(const char* IN_C_Node, char* IN_P_Name, int &tot_obligatorios, int IN_node_type);
			 int LeerDeArchivo(const char* nameFile, char *param1, char *param2, int *param3, int *param4, int *param5, int Linea ); // Para el DTD

	public:     
             
			 c_xmlcontainer_list XML_List; //Estrcutra de XML 

			 ~c_xmlparser();
			 int ReadFile(char* file_to_read);
			 int Parse_File(void);

		 


			 char load_expected(char after_char, int stat); // Agrega esperados despues del caracter


};
